const NodeMediaServer = require("node-media-server");

let {webPort,streamPort}= require('./config')

const config = {
    rtmp: {
        port: streamPort,
        chunk_size: 60000,
        gop_cache: true,
        ping: 60,
        ping_timeout: 30,
    },
    http: {
        port: webPort,
        allow_origin: "*",
    },
};

let nms = new NodeMediaServer(config);

module.exports = () => {
    nms.run();
}